<template>
    <div id="en">
        <h3>{{ title }}</h3>
        <div>
            <button @click="count--">-</button>
            <span>{{ count }}</span>
            <button @click="count++">+</button>
        </div>
    </div>

</template>

<script>
    export default {
        name: "7-v-computed计算属性",
        data() {
            return {
                count: 100,
                title: '计数器'
            }
        },
        methods: {

        },
        async created () {
            // 1. 发送请求获取数据
            const res = await axios.get('http://hmajax.itheima.net/api/news')
            // 2. 更新到 list 中，用于页面渲染 v-for
            this.list = res.data.data
        }


    }
</script>

<style scoped>

</style>
